  {% if deadline_components %}
  <script type="text/javascript">
    var deadline = new Date(Date.UTC({{ deadline_components }}));
  </script>
  {% endif %}
  {% if not board.closed %}
  <script type="text/javascript">
    var countdown_seconds = {{ countdown_seconds }};
    var countdown_timer = {};
    function format_countdown(total_seconds) {
      seconds = total_seconds;
      hours = Math.floor(seconds / 3600);
      seconds = seconds % 3600;
      minutes = Math.floor(seconds / 60);
      if (minutes < 10) {
        minutes = '0' + minutes;
      }
      seconds = seconds % 60;
      if (seconds < 10) {
        seconds = '0' + seconds;
      }
      return hours + ':' + minutes + ':' + seconds;
    }
    function display_countdown() {
      if (countdown_seconds > 0) {
        countdown_seconds--;
      } else {
        clearInterval(countdown_timer);
      }
      document.getElementById('countdown').innerHTML = format_countdown(countdown_seconds) + ' secs';
    }
    function start_countdown() {
      countdown_timer = setInterval('display_countdown()', 1000);
    }
  </script>
  {% endif %}
  <script type="text/javascript">
    function countdown_init() {
      {% if not board.closed %}
      display_countdown();
      start_countdown();
      {% endif %}
      document.getElementById('deadline').innerHTML = deadline.toString();
    }
	__startup__.push(countdown_init);
  </script>
  <div id="header">
    <h2>{{ board.title }}</h2>
    <blockquote>{{ board.description|escape }}</blockquote>
    {% if not board.closed %}
    <p>This board will close and reveal:</p>
    <blockquote>
    <p>in <span id="countdown">00:00:00</span></p>
    <p>on <strong><span id="deadline"></span></strong></p>
    </blockquote>
    {% else %}
    <p>This board was closed and revealed:</p>
    <blockquote>
    <p>on <strong><span id="deadline"></span></strong></p>
    </blockquote>
    {% endif %}
  </div>
  <div id="content">
    {% if not board.closed %}
    <h2>Post New Message</h2>
    <form action="/post_message" method="post" class="tabular">
      <input type="hidden" name="key" value="{{ key }}" />
      <label for="message">Message:</label> <textarea name="message" id="message" rows="3" cols="60"></textarea>
      <br />
      <input type="submit" value="Post Message" />
    </form>
    {% endif %}
    <div id="posts">
      <ol>
      {% for post in posts %}
        <li>
        {% if not board.closed %}
          {% if post.author %}
          <b>{{ post.author.nickname }}</b> posted something on {{ post.created_at|date:"Y-m-d H:i:s" }}.
          {% else %}
          An anonymous person posted something on {{ post.created_at|date:"Y-m-d H:i:s" }}.
          {% endif %}
        {% else %}
          {% if post.author %}
          <b>{{ post.author.nickname }}</b> posted on {{ post.created_at }}:
          {% else %}
          An anonymous person posted on {{ post.created_at }}:
          {% endif %}
          <blockquote>{{ post.message|escape }}</blockquote>
        {% endif %}
        </li>
      {% endfor %}
      </ol>
    </div>